package com.system.controller.user;

import com.common.core.controller.BaseController;
import com.common.core.domain.Result;
import com.common.core.domain.TableDataInfo;
import com.system.domain.user.dto.UserDTO;
import com.system.domain.user.dto.UserQueryDTO;
import com.system.service.user.UserService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
@Tag(name = "用户API")
public class UserController extends BaseController {
    @Resource
    UserService userService;

    /**
     *获取用户列表
     *
     */
    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDTO){
        return getTableData(userService.list(userQueryDTO));
    }

    /**
     * 修改用户状态
     *
     */
    @PutMapping("/updateStatus")
    public Result<Void> updateStatus(@RequestBody UserDTO userDTO){
        return toResult(userService.updateStatus(userDTO));
    }
}
